package com.yunda.nebula.gateway.service.impl;

import com.yunda.nebula.gateway.core.entity.FetchAppInfo;
import com.yunda.nebula.gateway.service.INotifyService;
import com.yunda.nebula.gateway.wrapper.DeferredResultWrapper;
import org.springframework.stereotype.Service;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * \* User: wei.zhang
 * \* Date: 2020/9/18 10:06
 * \* Description:
 *
 * @author wei.zhang
 * \
 */
@Service
public class NotifyServiceImpl implements INotifyService {
    private Map<String,DeferredResultWrapper> resultWrapperMap = new ConcurrentHashMap<>();


    @Override
    public boolean setResult(String key, DeferredResultWrapper resultWrapper) {
        resultWrapperMap.put(key,resultWrapper);
        return true;
    }

    @Override
    public void remove(String key) {
        resultWrapperMap.remove(key);
    }

    @Override
    public void notify(String key, FetchAppInfo fetchAppInfo) {

    }
}
